function _call(context = window) {
  const args = [...arguments].slice(1);

  context.fn = this;

  context.fn(...args);
  delete context.fn;
}

function _apply(context = window) {
  const args = [...arguments][1];
  context.fn = this;

  context.fn(...args);
  delete context.fn;
}

function _bind(context = window) {
  const args = [...arguments].slice(1);

  context.fn = this;
  return function (...rest) {
    context.fn([...args, ...rest]);
    delete context.fn;
  };
}
Function.prototype._call = _call;
Function.prototype._apply = _apply;
Function.prototype._bind = _bind;
const sum = (a, b) => {
  console.log(a + b);
};
let otherFun = () => {};

sum._call(otherFun, 1, 2);
sum._call(otherFun, [1, 2]);
sum._call(otherFun(), 1, 2);
